package com.googlecode.kipler.satisfiability.completion.strategy;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

import com.googlecode.kipler.container.dl.Individual;
import com.googlecode.kipler.container.dl.SHOIQABox;
import com.googlecode.kipler.container.dl.World;
import com.googlecode.kipler.container.dl.WorldConstraintSystem;
import com.googlecode.kipler.container.dl.operational.SHOIQIndividualComparator;


public class NominalFeeder implements IndividualFeeder {

	private WorldConstraintSystem wcs;

	private World world;

	public WorldConstraintSystem getWcs() {
		return wcs;
	}

	public void setWcs(WorldConstraintSystem wcs) {
		this.wcs = wcs;
	}

	public World getWorld() {
		return world;
	}

	public void setWorld(World world) {
		this.world = world;
	}

	@Override
	public Iterator<Individual> iterator() {
		SHOIQABox abox = (SHOIQABox) getWorld().getABox();
		List<Individual> result = new ArrayList<Individual>(abox.getNominals());
		Collections.sort(result, new SHOIQIndividualComparator());
		return result.iterator();
	}

}
